package eu.telecom_bretagne.RECRUT.data.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the dossier_candidature database table.
 * 
 */
@Entity
@Table(name="dossier_candidature")
@NamedQuery(name="DossierCandidature.findAll", query="SELECT d FROM DossierCandidature d")
public class DossierCandidature implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DOSSIER_CANDIDATURE_ID_GENERATOR", sequenceName="DOSSIER_CANDIDATURE_ID_SEQ", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DOSSIER_CANDIDATURE_ID_GENERATOR")
	private Integer id;

	@Column(name="titre_dossier")
	private String titreDossier;
	
	@Column (name="retenir_dossier")
	private boolean retenirDossier;
	
	@Column(name="validationRH")
	private boolean validationRH;
	
	@Column(name="validationDD")
	private boolean validationDD;

	//bi-directional many-to-one association to Archive
	@OneToMany(mappedBy="dossierCandidature")
	private Set<Archive> archives;

	//bi-directional many-to-one association to Candidature
	@ManyToOne
	@JoinColumn(name="id_candidature")
	private Candidature candidature;

	//bi-directional many-to-one association to Offre
	@ManyToOne
	@JoinColumn(name="id_offre")
	private Offre offre;

	//bi-directional many-to-one association to Entretien
	@OneToMany(mappedBy="dossierCandidature")
	private Set<Entretien> entretiens;

	//bi-directional many-to-many association to Employe
	@ManyToMany(mappedBy="dossierCandidatures")
	private Set<Employe> employes;

	public DossierCandidature() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitreDossier() {
		return this.titreDossier;
	}

	public void setTitreDossier(String titreDossier) {
		this.titreDossier = titreDossier;
	}
	
	public boolean getRetenir(){
		return this.retenirDossier;
	}
	
	public void setRetenirDossier(boolean retenirDossier) {
		this.retenirDossier = retenirDossier;
	}
		
	public boolean getValidationRH(){
		return this.validationRH;
	}
	
	public void setValidationRH(boolean validationRH) {
		this.validationRH = validationRH;
	}
	
	public boolean getValidationDD(){
		return this.validationDD;
	}
	
	public void setValidationDD(boolean validationDD) {
		this.validationDD = validationDD;
	}

	public Set<Archive> getArchives() {
		return this.archives;
	}

	public void setArchives(Set<Archive> archives) {
		this.archives = archives;
	}

	public Archive addArchive(Archive archive) {
		getArchives().add(archive);
		archive.setDossierCandidature(this);

		return archive;
	}

	public Archive removeArchive(Archive archive) {
		getArchives().remove(archive);
		archive.setDossierCandidature(null);

		return archive;
	}

	public Candidature getCandidature() {
		return this.candidature;
	}

	public void setCandidature(Candidature candidature) {
		this.candidature = candidature;
	}

	public Offre getOffre() {
		return this.offre;
	}

	public void setOffre(Offre offre) {
		this.offre = offre;
	}

	public Set<Entretien> getEntretiens() {
		return this.entretiens;
	}

	public void setEntretiens(Set<Entretien> entretiens) {
		this.entretiens = entretiens;
	}

	public Entretien addEntretien(Entretien entretien) {
		getEntretiens().add(entretien);
		entretien.setDossierCandidature(this);

		return entretien;
	}

	public Entretien removeEntretien(Entretien entretien) {
		getEntretiens().remove(entretien);
		entretien.setDossierCandidature(null);

		return entretien;
	}

	public Set<Employe> getEmployes() {
		return this.employes;
	}

	public void setEmployes(Set<Employe> employes) {
		this.employes = employes;
	}

}